import * as vscode from "vscode";
export enum ConfigurationItem {
  USER_CENTER_TOOL = "userCenterTool",
  CHATJPT_TOOL = "chatjptTool",
  NODEJS_TOOL = "nodeJsTool",
}

export enum ConfigurationKey {
  ACCOUNT_TOKEN = "AccountToken",
  USER_AGNET = "UserAgnet",
  OPEN_MAP = "OpenMap",
  INSTALL_SCRIPT = "InstallScript",
  BOX3_API_TYPE = "Box3APIType",
  ENABLE_HMR_TS_ERROR_POPUP_LOGGING = "EnableHmrTsErrorPopupLogging",
  CHATJPT_SHORTCUT_CODE = "ShortcutCode",
  CHATJPT_SHORTCUT_CODE_FUNCTION = "ShortcutCodeFunction",
  CHATJPT_SHORTCUT_CODE_ANY_FUNCTION = "ShortcutCodeAnyFunction",
  CHATJPT_SHORTCUT_CODE_MODULE = "ShortcutCodeModule",
  CHATJPT_SHORTCUT_CODE_NAMESPACE = "ShortcutCodeNamespace",
  CHATJPT_SHORTCUT_CODE_CLASS = "ShortcutCodeClass",
  CHATJPT_SHORTCUT_CODE_METHOD = "ShortcutCodeMethod",
  CHATJPT_SHORTCUT_CODE_CONSTRUCTOR = "ShortcutCodeConstructor",
  CHATJPT_SHORTCUT_CODE_ENUM = "ShortcutCodeEnum",
  CHATJPT_SHORTCUT_CODE_INTERFACE = "ShortcutCodeInterface",
  CHATJPT_SHORTCUT_CODE_VARIABLE = "ShortcutCodeVariable",
}

export async function setInsConfig(config: string, key: string, value: any) {
  await vscode.workspace
    .getConfiguration(config)
    .update(key, value, vscode.ConfigurationTarget.Global);
}
